package com.xqboss.apps.domain.nft;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.xqboss.common.core.domain.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.math.BigDecimal;
import java.util.Date;

/**
 * @author HaoLun
 * @since 2022-09-07
 */
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@ApiModel(value = "NftBeforeRule对象", description = "")
public class NftBeforeRule extends BaseEntity {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    @ApiModelProperty(value = "前置nft规则集合")
    private String beforeNfts;

    @ApiModelProperty(value = "购买的nft ID 或者 箱子ID")
    private Long nftId;

    @ApiModelProperty(value = "类型 1藏品 2箱子 3活动")
    private Integer ruleType = 1;


    @ApiModelProperty(value = "规则模式 1任意匹配 2完全匹配")
    private Integer ruleMode;

    @ApiModelProperty(value = "持有数量")
    private Integer ownNum;

    @ApiModelProperty(value = "购买次数")
    private Integer buyTimes;

    @ApiModelProperty(value = "折扣金额 根据折扣模式来判断 1比例 2 是固定金额")
    private BigDecimal discountNum;

    @ApiModelProperty(value = "次数叠加 1 开启 0关闭")
    private Integer timesAdd;

    @ApiModelProperty(value = "叠加次数（每增加一倍叠加的数量）")
    private Integer addTimes;

    @ApiModelProperty(value = "叠加优惠 根据折扣模式判断是比例还是固定金额")
    private BigDecimal addDiscount;

    @ApiModelProperty(value = "额外空投 1开启 0关闭")
    private Integer extraReward;

    @ApiModelProperty(value = "额外空投规则集合")
    private String extraRules;

    @JsonIgnore
    @TableLogic(value = "null",delval = "now()")
    protected Date deleteTime;

}
